package d.n.d.domain;

import java.io.Serializable;

import javax.persistence.*;

import java.util.Date;


/**
 * The persistent class for the transaction database table.
 * 
 */
@Entity
@NamedQuery(name="Transaction.findAll", query="SELECT t FROM Transaction t")
public class Transaction implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int idTransaction;

	@Temporal(TemporalType.TIMESTAMP)
	private Date beginTime;

	private double changeAmount;

	private String comment;

	@Temporal(TemporalType.TIMESTAMP)
	private Date endTime;

	private String transactionStatus;

	private String transactionType;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="userAdmin")
	private User userAdmin;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="userSupport")
	private User userSupport;

	//bi-directional many-to-one association to Account
	@ManyToOne
	@JoinColumn(name="receiveAccount")
	private Account receiveAccount;

	//bi-directional many-to-one association to Account
	@ManyToOne
	@JoinColumn(name="sendAccount")
	private Account sendAccount;

	public Transaction() {
	}

/*	public Transaction(Date date, double doubleAmount,
			String transactionTypeAddfunds, String transactionStatePending,
			Account tempAccount, Object object, Object object2, User userSupport) {
		// TODO Auto-generated constructor stub
	}*/
	public Transaction(Date beginTime, Double changeAmount,
			String transactionType, String transactionStatus,
			Account sendAccount, Account receiveAccount, User userAdmin,
			User userSupport) {
		super();
		this.beginTime = beginTime;
		this.changeAmount = changeAmount;
		this.transactionType = transactionType;
		this.transactionStatus = transactionStatus;
		this.sendAccount = sendAccount;
		this.receiveAccount = receiveAccount;
		this.userAdmin = userAdmin;
		this.userSupport = userSupport;
	}

	public Transaction(Date beginTime, Double changeAmount,
			String transactionType, String transactionStatus,
			Account sendAccount, Account receiveAccount, User userSupport) {
		super();
		this.beginTime = beginTime;
		this.changeAmount = changeAmount;
		this.transactionType = transactionType;
		this.transactionStatus = transactionStatus;
		this.sendAccount = sendAccount;
		this.receiveAccount = receiveAccount;
		this.userSupport = userSupport;
	}

	public int getIdTransaction() {
		return this.idTransaction;
	}

	public void setIdTransaction(int idTransaction) {
		this.idTransaction = idTransaction;
	}

	public Date getBeginTime() {
		return this.beginTime;
	}

	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}

	public double getChangeAmount() {
		return this.changeAmount;
	}

	public void setChangeAmount(double changeAmount) {
		this.changeAmount = changeAmount;
	}

	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getTransactionStatus() {
		return this.transactionStatus;
	}

	public void setTransactionStatus(String transactionStatus) {
		this.transactionStatus = transactionStatus;
	}

	public String getTransactionType() {
		return this.transactionType;
	}

	public void setTransactionType(String transactionType) {
		this.transactionType = transactionType;
	}

	public User getUserAdmin() {
		return this.userAdmin;
	}

	public void setUserAdmin(User userAdmin) {
		this.userAdmin = userAdmin;
	}

	public User getUserSupport() {
		return this.userSupport;
	}

	public void setUserSupport(User userSupport) {
		this.userSupport = userSupport;
	}

	public Account getReceiveAccount() {
		return this.receiveAccount;
	}

	public void setReceiveAccount(Account receiveAccount) {
		this.receiveAccount = receiveAccount;
	}

	public Account getSendAccount() {
		return this.sendAccount;
	}

	public void setAccount2(Account sendAccount) {
		this.sendAccount = sendAccount;
	}

}